package org.expath.httpclient.test.server.tests;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import org.expath.httpclient.test.server.BaseTest;
import org.expath.httpclient.test.server.EmptyBodyAsserter;
import org.expath.httpclient.test.server.TestRequest.Failure;

/**
 * ...
 *
 * @author Florent Georges
 */
public class Headers002
        extends BaseTest
{
    public Headers002()
    {
        super("headers-002");
    }

    @Override
    protected void doCheck(HttpServletRequest req, Failure f)
            throws ServletException
    {
        assertMethod(req, f, "POST");
        assertHeader(req, f, "X-EXPath-Test", "The exact value");
        assertHeader(req, f, "Content-Length", 0);
        assertNoHeader(req, f, "Content-Type");
        assertBody(req, f, new EmptyBodyAsserter());
    }
}
